using System;
using System.Data.Linq.Mapping;
using CoreLibrary.Date;

namespace Entities.DataBase.Persistent {

    [Table(Name = "D_ORDER_RECORD")]
    public class OrderRecord {

        public OrderRecord() {
            DateCreated = DateTime.UtcNow;
            DateUpdated = DateUtil.Epoch;
        }

        [Column(Name = "ID", IsPrimaryKey = true, IsDbGenerated = true)]
        public int Id            { get; set; }

        [Column(Name = "ORDER_ID")]
        public string OrderId    { get; set; }

        [Column(Name = "STOCK_ID")]
        public int StockId       { get; set; }

        [Column(Name = "PRODUCT_ID")]
        public string ProductId  { get; set; }

        [Column(Name = "CUSTOMER_ID")]
        public string CustomerId { get; set; }

        [Column(Name = "COST")]
        public decimal Cost { get; set; }

        [Column(Name = "COST_CURRENCY")]
        public string  CostCurrency { get; set; }

        [Column(Name = "POSTAGE")]
        public decimal Postage { get; set; }

        [Column(Name = "POSTAGE_CURRENCY")]
        public string  PostageCurrency { get; set; }

        [Column(Name = "ORDER_POSTAGE")]
        public decimal AvgOrderPostage { get; set; }

        [Column(Name = "ORDER_POSTAGE_CURRENCY")]
        public string  AvgOrderPostageCurrency { get; set; }

        [Column(Name = "PRICE")]
        public decimal Price     { get; set; }

        [Column(Name = "PRICE_CURRENCY")]
        public string PriceCurrency { get; set; }

        [Column(Name = "COUNT")]
        public int Count            { get; set; }

        [Column(Name = "DATE_CREATED")]
        public DateTime DateCreated { get; set; }

        [Column(Name = "DATE_UPDATED")]
        public DateTime DateUpdated { get; set; }

    }
}